import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { Transport } from '@nestjs/microservices';

async function bootstrap() {
  const app = await NestFactory.createMicroservice(AppModule, {
    transport: Transport.RMQ,
    options: {
      urls: [`amqp://guest:guest@localhost:5672`],
      queue: 'logging_service_transport',//我要监听 logging_service_transport 队列里面的消息
      queueOptions: { durable: false },
    },
  });
  await app.listen(() => console.log('日志微服务已经启动...'));
}
bootstrap();
